<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Transfer money</title>
</head>
<body>
<jsp:include page="links.html"></jsp:include>
<form name="transferMoneyForm" action="/BankWeb/BankServlet" method="POST">
<%
String createResp = null;
try{
	createResp = (String) session.getAttribute("BankServlet.createResponse"); //check if there is a response to print.
}catch(Exception e){
	
}
if(createResp!=null) {
%>
<center>
<br/>
<b>
<%=createResp %>
<%session.setAttribute("BankServlet.createResponse", null); //reset the session variable so it does not interfere with other pages.%>
</b>
</center>
<%
}else{
%>
<table>
	<tr>
		<td>First account number (From):</td>
		<td><input type="text" name="accountNumber1"/> </td>
	</tr>
	<tr>
		<td>Second account number (To):</td>
		<td><input type="text" name="accountNumber2" /> </td>
	</tr>
	<tr>
		<td>Amount to transfer:</td>
		<td><input type="text" name="amount" /> </td>
	</tr>
	<tr>
		<td><input type="hidden" name="action" value="TRANSFER"/></td>
		<td><input type="submit" name="Submit" value="Confirm transfer" /> </td>
	</tr>	
</table>
<%
}%>

</form>
</body>
</html>